class Solution {
    public int add(int a, int b) {
        while (b != 0) {
            int j = a ^ b;
            int k = (a & b) << 1;
            a = j;
            b = k;
        }
        return a;
    }

    public static void main(String[] args) {
        Solution s = new Solution();
        System.out.println(s.add(-1, -2));
    }
}
